From 94168cf8452d787a171c69ad5a25b97f7ca0530f Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 25 Mar 2002 20:11:27 +0000 Subject: [PATCH] free the style's font_description before accessing a new one. 2002-03-25 Sven Neumann * gtk/gtkrc.c (gtk_rc_parse_font_name): free the style's font_description before accessing a new one. (gtk_rc_parse_stock): always unref the created icon_set. #76289 --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkrc.c | 17 +++++++++++------ 7 files changed, 47 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3f002d424..5a0500cd9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-03-25 Sven Neumann + + * gtk/gtkrc.c (gtk_rc_parse_font_name): free the style's + font_description before accessing a new one. + (gtk_rc_parse_stock): always unref the created icon_set. #76289 + 2002-03-25 Mark McLoughlin * gtk/gtkbindings.c: (gtk_binding_entry_add_signal), diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c3f002d424..5a0500cd9c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2002-03-25 Sven Neumann + + * gtk/gtkrc.c (gtk_rc_parse_font_name): free the style's + font_description before accessing a new one. + (gtk_rc_parse_stock): always unref the created icon_set. #76289 + 2002-03-25 Mark McLoughlin * gtk/gtkbindings.c: (gtk_binding_entry_add_signal), diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index c3f002d424..5a0500cd9c 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +2002-03-25 Sven Neumann + + * gtk/gtkrc.c (gtk_rc_parse_font_name): free the style's + font_description before accessing a new one. + (gtk_rc_parse_stock): always unref the created icon_set. #76289 + 2002-03-25 Mark McLoughlin * gtk/gtkbindings.c: (gtk_binding_entry_add_signal), diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index c3f002d424..5a0500cd9c 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +2002-03-25 Sven Neumann + + * gtk/gtkrc.c (gtk_rc_parse_font_name): free the style's + font_description before accessing a new one. + (gtk_rc_parse_stock): always unref the created icon_set. #76289 + 2002-03-25 Mark McLoughlin * gtk/gtkbindings.c: (gtk_binding_entry_add_signal), diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index c3f002d424..5a0500cd9c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2002-03-25 Sven Neumann + + * gtk/gtkrc.c (gtk_rc_parse_font_name): free the style's + font_description before accessing a new one. + (gtk_rc_parse_stock): always unref the created icon_set. #76289 + 2002-03-25 Mark McLoughlin * gtk/gtkbindings.c: (gtk_binding_entry_add_signal), diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c3f002d424..5a0500cd9c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2002-03-25 Sven Neumann + + * gtk/gtkrc.c (gtk_rc_parse_font_name): free the style's + font_description before accessing a new one. + (gtk_rc_parse_stock): always unref the created icon_set. #76289 + 2002-03-25 Mark McLoughlin * gtk/gtkbindings.c: (gtk_binding_entry_add_signal), diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c index 7f400b765d..8c479b496f 100644 --- a/gtk/gtkrc.c +++ b/gtk/gtkrc.c @@ -2998,7 +2998,11 @@ gtk_rc_parse_font_name (GScanner *scanner, if (token != G_TOKEN_STRING) return G_TOKEN_STRING; - rc_style->font_desc = pango_font_description_from_string (scanner->value.v_string); + if (rc_style->font_desc) + pango_font_description_free (rc_style->font_desc); + + rc_style->font_desc = + pango_font_description_from_string (scanner->value.v_string); return G_TOKEN_NONE; } @@ -3752,12 +3756,13 @@ gtk_rc_parse_stock (GtkRcContext *context, } } - if (icon_set && icon_set_valid) + if (icon_set) { - gtk_icon_factory_add (factory, - stock_id, - icon_set); - + if (icon_set_valid) + gtk_icon_factory_add (factory, + stock_id, + icon_set); + gtk_icon_set_unref (icon_set); } -- 2.30.2